package org.example.spring.aop;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class Main {
    public static void main(String[] args) {
        ApplicationContext context = org.springframework.boot.SpringApplication.run(Main.class, args);
        RealSubject realSubject = context.getBean(RealSubject.class);
        realSubject.doSomething();
        try {
            realSubject.doSomethingElse();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
